<template>
    <div ref="chartRef" class="e-chart" style="width: 1000px;height:500px;"></div>
</template>
<script>
import *as echarts from 'echarts'
export default{
    props: ['tableData'],
    data() {
        return{
            echartData: []
        }
    },
    created() {

    },
    mounted() {
        console.log(this.tableData,'')
        // this.initData()
    },
    methods: {
        dataTab() {
            var myChart = echarts.init(this.$refs.chartRef);
            myChart.setOption({
                xAxis: {
                    type: 'category',
                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: [120, 200, 150, 80, 70, 110, 130],
                        type: 'bar'
                    }
                ]
            });
        },
        initData() {
            request({
                url: '/manager/statistics/dataCollegeQuery.jsp',
                method: 'post',
                data: {
                    txtAction: 'project',
                    startDate: this.startDate,
                    endDate: this.endDate
                }
            }).then(res => {
                if(res.code == 200) {
                    let dataArry = res.data || []
                    dataArry.forEach((obj) => {
                        dataArry.push(item)
                    })
                    this.dataTab()
                    // this.tableData = res.data || []
                    // this.loading = false
                }
            })
        }
    }
}
</script>
<style lang="less" scoped>
</style>